#include <iostream>

int a[7];

int main()
{
	for (int i = 0; i < 5; i++) std::cin >> a[i];
	int len = a[0] + a[1] + a[2];
	int ans = len * len - a[0] * a[0] - a[2] * a[2] - a[4] * a[4];
	std::cout << ans << '\n';
}
